# 该文件用于celery异步的运行文件
import os

from celery import Celery


# 1.创建celery实例对象
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'meiduo_mall.settings.dev')

celery_app = Celery('meiduo',backend='redis://localhost:6379/1', broker='redis://localhost:6379/0')

# 2.0加载配置文件

celery_app.config_from_object('celery_tasks.config')

# 3.0自动注册异步任务

celery_app.autodiscover_tasks(['celery_tasks.sms','celery_tasks.email'])
